<?php 
include  "../protegido/protected.php"; /*Valida el inico de sesion*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Libro</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

	<!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
	<!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
	<!--script src="js/less-1.3.3.min.js"></script-->
	<!--append ‘#!watch’ to the browser URL, then refresh the page. -->
	
	<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<link href="../bootstrap/css/style.css" rel="stylesheet">
	

  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
  <![endif]-->

  <!-- Fav and touch icons -->
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../bootstrap/img/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../bootstrap/img/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../bootstrap/img/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="../bootstrap/img/apple-touch-icon-57-precomposed.png">
  <link rel="shortcut icon" href="../bootstrap/img/Limasys2.1.png">
  
	<script type="text/javascript" src="../bootstrap/js/jquery.min.js"></script>
	<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../bootstrap/js/scripts.js"></script>
	
	 <script src="../js/jqueryvar.js"></script>
	 <script src="../js/jquery.validate.js"></script>

        <script>
         $(document).ready(function() {
              $("#frmlibro").validate({
                rules: {
                  txtIdLibro: {required: true, minlength: 1, maxlength: 12},
                  txtIdClasificacion: {required: true, minlength: 1, maxlength: 12},
                  txtIdInstitucional:{required: true, minlength: 1, maxlength: 12},
                  txtNombre: {required: true, textva: true},
                  txtAutor: {required: true, textva: true},
                  txtEdicion: {required: true, textva: true},
                  txtFechPublic:  {required: true, date: true},
                  txtGenero: {required: true},
                  txtTipo: {required: true, textva: true},
                  txtEstado: {required: true, textva: true},
                  txtFechIngre: {required: true, date: true},
                  txtDispo: {required: true, textva: true},
                  txtEstadoFi: {required: true, textva: true},
                  txtDescripccion: {required: true}
                },
                messages: {
                  txtIdLibro : "Id Libro Incorrecta: de 1 a 12 Dijitos ",
                  txtIdClasificacion : "Id Clasificacion Incorrecta: de 1 a 12 Dijitos",
                  txtIdInstitucional : "Id Institucioanl Incorrecta: de 1 a 12 Dijitos",
                  txtNombre : "Nombre no Valido, No se aceptan Numeros",
                  txtAutor : "Autor no Valido, No se aceptan Numeros",
                  txtEdicion : "Edicion no Valido, No se aceptan Numeros",
                  txtFechPublic : "Fecha no Valida, DD/MM/AAAA ",
                  txtGenero : "Genero no Valido",
                  txtTipo : "Tipo no Valido, No se aceptan Numeros",
                  txtEstado : "Estado no Valido, No se aceptan Numeros",
                  txtDispo : "Disponibilidad no Valida, No se aceptan Numeros",
                  txtFechIngre : "Fecha no Valida, DD/MM/AAAA ",
                  txtEstadoFi : "Estado Fisico no Valido, No se aceptan Numeros",
                  txtDescripccion : "Descripccion no Valida"
                }
              });
            });
         //console.log(messages.txtCedula);
        </script>
        <style>
            .error-message, label.error {
                color: #ff0000;
                margin:0;
                display: inline;
                font-size: 1em !important;
                font-weight:lighter;
            }
        </style>


</head>

<body>
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column ">
			<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"><!-- navbar-default acomoda el menu  //navbar-inverse navbar-fixed-top//-->
				<div class="navbar-header">
					 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="#">
					 	 <a class="navbar-brand" href="index.html">
                         <img src="../bootstrap/img/logo.png" alt="" />
                        </a>

					 </a>
				</div>
				
				<div class="collapse navbar-collapse " id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav ">
						<li class=>
							<a href="../menuadmin/index.html"><strong class="glyphicon glyphicon-list "></strong> Inicio</a>
						</li >
						<li class="dropdown">
							<a href="#"  class="dropdown-toggle" data-toggle="dropdown"> <strong class="glyphicon glyphicon-check"></strong> Usuarios<strong class="caret"></strong></a>
							<ul class="dropdown-menu">
								<li class="active">
									<a href="index.php">Administrador</a>
								</li>
								<li class="divider"></li>
								<li>
									<a href="../estudiante/index.php">Estudiante</a>
								</li>
								<li class="divider"></li>
								<li>
									<a href="../profesor/index.php">Profesores</a>
								</li>
							</ul>
						</li>
						<li class"active">
							<a href="../libro/index.php"> <strong class="glyphicon glyphicon-book"></strong> Libro</a>
						</li>
						<li >
						  <a href="../prestamoLibros/index.php"> <strong class="glyphicon glyphicon-tags"></strong> Prestamo de Libro</a>
						</li>
						<li>
							<a href="#"><strong class="glyphicon glyphicon-list-alt"></strong> Biblioteca Virtual</a>
						</li>
<!--
						<li>
							<a href="#"><strong class="glyphicon glyphicon-phone"></strong> Material Tecnologico</a>
						</li>
						<li>
							<a href="#"><strong class="glyphicon glyphicon-new-window"></strong> Prestamo Material Tecnologico</a>
						</li>
	-->
						<li>
							<a href="#"><strong class="glyphicon glyphicon-folder-open"></strong> Reportes</a>
						</li>
						<li>
							<a href="#"><strong class="glyphicon glyphicon-question-sign"></strong> Ayuda</a>
						</li>
					</ul>
					<!--<form class="navbar-form navbar-left" role="search">
						<div class="form-group">
							<input type="text" class="form-control">
						</div> <button type="submit" class="btn btn-default">Submit</button>
					</form>-->
					<ul class="nav navbar-nav navbar-right">
						<li>
							<a href="#"></a>
						</li>
						<li class="dropdown">
							 <a href="#" class="dropdown-toggle" data-toggle="dropdown"><strong class="glyphicon glyphicon-user"></strong></a>
							<ul class="dropdown-menu dropdown-user">
								
								<li>
									<a href="../Protegido/logoutAdmin.php">Salir</a>
								</li>
							</ul>
						</li>
					</ul>
				</div>
				
			</nav>

     <!--Agregamos el Link para retorceder -->

          <br><br><br><br>
                               <tr>
                                  <td>
                                      <a class="btn btn-success" href="index.php" ><span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>  Atras</a>
                                  </td>
                                  <td>
                                  </td>
                              </tr>


			
			<div class="page-header">
			<hr>
			<h3>Modificando al Libro :</h3>
			<?php
               include('../Tabla/conn/conn.php');
               require('../tabla/funciones/conexiones.php');
               $IdLibro = $_GET['id'];
               $sql="SELECT * FROM ls_06_registro_libro WHERE LS00IDLB ='$IdLibro'";
               $q = mysqli_query( $con, $sql);
               $row=$q->fetch_assoc();

               echo $row['LS03NBLB'].' '.$row['LS04AT'];
                  ?>
                  <hr>

                  <form action="guar_modLib.php" name="frmlibro" id="frmlibro" method="post" onsubmit=" return validacion();">
                           <table>
                            <tr>
                                <td>Codigo Libro : </td>
                                <td>
                                    <input onPaste = "return false;" placeholder="Codigo Libro" autocomplete="off" class="form-control" type="text" id="txtIdLibro" name="txtIdLibro" readonly value="<?php echo $row['LS00IDLB'];?>" required>
                                </td>
                            </tr>
                            <tr>
                                <td>Codigo Clasificacion : </td>
                                <td>
                                    <input onPaste = "return false;" placeholder="Codigo Clasificacion" autocomplete="off" class="form-control" type="text" id="txtIdClasificacion" name="txtIdClasificacion" value="<?php echo $row['LS01IDCL'];?>" required>
                                </td>
                            </tr>
                            <tr>
                                <td>Codigo Institucional : </td>
                                <td>
                                    <input onPaste = "return false;" placeholder="Codigo Institucional" autocomplete="off" class="form-control" type="text" id="txtIdInstitucional" name="txtIdInstitucional" value="<?php echo $row['LS02IDINT'];?>" required>
                                </td>
                            </tr>
                            <tr>
                                <td>Nombre Libro : </td>
                                <td>
                                    <input onPaste = "return false;" placeholder="Nombre Libro" autocomplete="off" class="form-control" type="text" id="txtNombre" name="txtNombre" value="<?php echo $row['LS03NBLB'];?>" required>
                                </td>
                            </tr>
                            <tr>
                                <td>Autor : </td>
                                <td>
                                <input onPaste = "return false;" placeholder="Autor" autocomplete="off" class="form-control" type="text" id="txtAutor" name="txtAutor" value="<?php echo $row['LS04AT'];?>" required>
                                </td>
                            </tr>
                            <tr>
                                <td>Edicion : </td>
                                <td>
                                <input onPaste = "return false;" placeholder="Edicio" autocomplete="off" class="form-control" type="text" id="txtEdicion" name="txtEdicion" value="<?php echo $row['LS05ED'];?>" required>
                                </td>
                            </tr>
                            <tr>
                                <td>Fecha de Publicacion : </td>
                                <td>
                                <input onPaste = "return false;" placeholder="Fecha de Publicacion" autocomplete="off" class="form-control" type="date" id="txtFechPublic" name="txtFechPublic" value="<?php echo $row['LS06AP'];?>" required>
                                </td>
                            </tr>
                            <tr>
                                <td>Genero : </td>
                                <td>
                                <input onPaste = "return false;" placeholder="Genero" autocomplete="off"  class="form-control" type="text" id="txtGenero" name="txtGenero" value="<?php echo $row['LS07GN'];?>" required>
                                
                            </td>
                            <tr>
                                <td>Tipo : </td>
                                <td>
                                <input onPaste = "return false;" placeholder="Tipo" autocomplete="off" class="form-control" type="text" id="txtTipo" name="txtTipo" value="<?php echo $row['LS08TP'];?>" required>
                                </td>
                            </tr>
                            <tr>
                                <td>Estado : </td>
                                <td>
                                <input onPaste = "return false;" placeholder="Estado" autocomplete="off"  class="form-control" type="text" id="txtEstado" name="txtEstado"  value="<?php echo $row['LS09ET'];?>" required>
                                
                                </td>
                            </tr>
                            <tr>
                                <td>Fecha de Ingreso : </td>
                                <td>
                                <input onPaste = "return false;" placeholder="Fecha" autocomplete="off"  class="form-control" type="date" id="txtFechIngre" name="txtFechIngre" value="<?php echo $row['LS10FI'];?>" required>
                                </td>
                            </tr>
                            <tr>
                                <td>Disponibilidad : </td>
                                <td>
                                <input onPaste = "return false;" placeholder="Disponibilidad" autocomplete="off"  class="form-control" type="text" id="txtDispo" name="txtDispo" value="<?php echo $row['LS11DB'];?>"readonly required>
                                
                                </td>
                            </tr>

                             <tr>
                                <td>Estado Fisico : </td>
                                <td>
                                <input onPaste = "return false;" placeholder="Estado Fisico" autocomplete="off"  class="form-control" type="text" id="txtEstadoFi" name="txtEstadoFi" value="<?php echo $row['LS12EF'];?>" required>
                                
                                </td>
                            </tr>

                            <tr>
                                <td>Descripccion : </td>
                                <td>
                                <input onPaste = "return false;" placeholder="Descripccion"   class="form-control" id="txtDescripccion" name="txtDescripccion" required rows="5" cols="20" value="<?php echo $row['LS13DP'];?>">
                                <!--<input class="form-control" type="text" id="txtDescripccion" name="txtDescripccion" required>-->
                                </td>
                            </tr>
                            <tr>
                              
                              
                                <td>
                                <br>
                               </br>
                                    <input class="btn btn-primary" type="submit" id="btnProcesar" name="btnProcesar" value="Guardar Libro">
                                </td>
                                
                            </tr>
                         
                        </table>
                    </form>
			</div>
		</div>
	</div>
</div>
</div>

<div class="footer_btm"><!-- start footer_btm -->
  <div class="container">
    <div class="navbar navbar-default">

      
               
                <a class="navbar-brand" >
                    <img class="img-rounded" align="left" src="../bootstrap/img/barrainferios/limasys.png" alt="" />
                </a>
                <a class="navbar-brand" align="left">
                    <img <img class="img-rounded" align="left" src="../bootstrap/img/barrainferios/ctp.png" alt="" />
                </a>

               <a class="navbar-brand" align="left">
                    <img <img class="img-rounded" align="left" src="../bootstrap/img/barrainferios/una.png" alt="" />
                </a>

        <p class=""><span>&#169; Reservado todo los Derechos|2014| Diseñado por&nbsp;<a href="http://LYMASYS/"> Javier Villarreal y Josue Morales</a></span></p>
    </div>
  </div>
</div>
</body>
</html>
